cmake_minimum_required(VERSION 3.10)
project(pub_sub_test)

include_directories(include)
include_directories(include/nanomsg)
include_directories(include/cpp-ipc)
link_directories(lib/cpp-ipc)
link_directories(lib/nanomsg)


set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2")
add_executable(pub_nanomsg_shm pub_nanomsg_shm.cc)
add_executable(sub_nanomsg_shm sub_nanomsg_shm.cc)
target_compile_definitions(pub_nanomsg_shm PRIVATE ENABLE_CRC_CHECK=0)
target_compile_definitions(sub_nanomsg_shm PRIVATE ENABLE_CRC_CHECK=0)
target_link_libraries(pub_nanomsg_shm ipc nanomsg pthread anl rt z gcc_s)
target_link_libraries(sub_nanomsg_shm ipc nanomsg pthread anl rt z gcc_s)

add_executable(pub_nanomsg pub_nanomsg.cc)
add_executable(sub_nanomsg sub_nanomsg.cc)
target_compile_definitions(pub_nanomsg PRIVATE THROTTLE_MESSAGE_SLEEP=2000)
target_compile_definitions(pub_nanomsg PRIVATE ENABLE_CRC_CHECK=0)
target_compile_definitions(sub_nanomsg PRIVATE ENABLE_CRC_CHECK=0)
target_link_libraries(pub_nanomsg ipc nanomsg pthread anl rt z gcc_s)
target_link_libraries(sub_nanomsg ipc nanomsg pthread anl rt z gcc_s)
